package com.daedalus.Gui.shape;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JComponent;


public class KomponentiGrafik extends JComponent{

	int x,y,w,h,choice;
	
	public KomponentiGrafik(int xK, int yK, int width, int height, int ch){
		setSize(400,400);
		setLayout(null);

		x=xK;
		y=yK;
		w=width;
		h=height;
		choice=ch;
		
	}
	
	public void paint(Graphics g){
		super.paint(g);
		if (choice==1){
			g.setColor(Color.red);
			g.fillRect(x, y, w, h);
		}
		else if(choice==2){
			g.setColor(Color.CYAN);
			g.fillOval(x, y, w, h);
		}
	}
}
